Srcs := $(wildcard *.c *.cc *.cpp)
Exes := $(patsubst %.c, %, $(patsubst %.cc, %, $(patsubst %.cpp, %, $(Srcs))))
CC := gcc
CXX := g++
CFLAGS := -Wall -g

ALL: $(Exes)

%: %.c
	$(CC) $^ -o $@ $(CFLAGS)
%: %.cc
	$(CXX) $^ -o $@ $(CFLAGS)	-lpthread -llog4cpp
%: %.cpp
	$(CXX) $^ -o $@ $(CFLAGS)

.PHONY: ALL clean rebuild

clean:
	$(RM) $(Exes)
rebuild: clean ALL
